﻿using PGMHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WSAP
{
    public partial class WSAPCurveForm : Form
    {
        /// <summary>
        /// 曲线集合
        /// </summary>
        private WSAPCurveSet CurveSet { set; get; }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="curveSet"></param>
        public WSAPCurveForm(WSAPCurveSet curveSet)
        {
            InitializeComponent();
            this.CurveSet = curveSet;
            this.TabCtrl.SetApperance();
            this.GridView.SetApperance(DataGridViewSelectionMode.FullColumnSelect);
            this.GraphChart.SetApperance(StringAlignment.Near, true);
            this.GraphChart.SetAxisFormat(ChartAxisType.AxisX, AxisFormat.Science, 2);
            this.GraphChart.SetAxisFormat(ChartAxisType.AxisY, AxisFormat.Science, 2);
        }

        /// <summary>
        /// 窗体显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WSAPCurveForm_Shown(object sender, EventArgs e)
        {
            this.CurveSet.ToChart(this.GraphChart);
            this.GridView.AddDatas(this.CurveSet.GetData());
        }
    }
}
